home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 86
/
(Vol 86) My Disc.iso
/
Games
/
restaurante_1072.swf
/
scripts
/
__Packages
/
Waitress.as
< prev
Wrap
Text File
|
2009-04-16
|
12KB
|
336 lines
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(!_global.Waitress)
{
_global.Waitress extends MissionItem;
var _loc2_ = _global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.prototype;
_loc2_.setDirection = function(d)
{
this.direction = d;
this.refreshDirection();
};
_loc2_.menuService = function(t, mc)
{
function backToKitchen()
{
obj._isBusy = false;
if(!t.__get__customerLeave() && !t.__get__isNotFull())
{
Mission.getMission().__get__kitchen().addMenu(t);
}
}
if(this.__get__isMusicing())
{
this.stopMusic();
}
var obj = this;
this._isBusy = true;
this.__set__status(Waitress.WALK);
this.setPath(this.createPath(t).concat(),function()
{
obj.currentTable = t;
obj.goBack(t,backToKitchen);
if(mc)
{
mc.removeMovieClip();
}
}
);
};
_loc2_.foodService = function(food, t)
{
function gotFood()
{
food.__get__mc().removeMovieClip();
if(t.__get__customerLeave() || t.__get__isNotFull())
{
delete food;
obj._isBusy = false;
return undefined;
}
obj.__set__status(Waitress.FULL);
obj.setPath(obj.createPath(t).concat(),function()
{
obj.currentTable = t;
obj._isBusy = false;
obj.__set__status(Waitress.STAND);
if(!t.__get__customerLeave() && !t.__get__isNotFull())
{
t.getFood(food);
}
else
{
delete food;
}
}
);
}
if(this.__get__isMusicing())
{
this.stopMusic();
}
var obj = this;
this._isBusy = true;
if(this.currentTable == null)
{
gotFood();
}
else
{
this.goBack(this.currentTable,gotFood);
}
};
_loc2_.cleanService = function(t)
{
function backToKitchen()
{
obj._isBusy = false;
}
if(this.__get__isMusicing())
{
this.stopMusic();
}
var obj = this;
this._isBusy = true;
this.__set__status(Waitress.WALK);
this.setPath(this.createPath(t).concat(),function()
{
obj.currentTable = t;
t.__get__food().__get__mc().removeMovieClip();
t.__set__status(Table.EATTED);
obj.goBack(t,backToKitchen,Waitress.EMPTY);
}
);
};
_loc2_.musicService = function(t)
{
if(this.__get__isMusicing())
{
this.stopMusic();
}
var obj = this;
this._isBusy = true;
this.__set__status(Waitress.WALK);
this.setPath(this.createPath(t).concat(),function()
{
obj._isBusy = false;
obj.currentTable = t;
obj.__set__status(Waitress.MUSIC);
t.listenMusic();
}
);
};
_loc2_.__get__isMusicing = function()
{
return this.__get__status() == Waitress.MUSIC;
};
_loc2_.stopMusic = function()
{
this.currentTable.musicStop();
};
_loc2_.__set__status = function(value)
{
super.__set__status(value);
this.refreshDirection();
return this.__get__status();
};
_loc2_.__get__isBusy = function()
{
return this._isBusy;
};
_loc2_.__get__bornPoint = function()
{
return MissionData.DATA[Mission.getMission().__get__id()].waitress.bornPoint;
};
_loc2_.__get__rendezvousPoint = function()
{
return MissionData.DATA[Mission.getMission().__get__id()].waitress.rendezous;
};
_loc2_.createPath = function(t)
{
if(this.currentTable == t)
{
return [];
}
var _loc2_ = undefined;
if(this.currentTable == null)
{
_loc2_ = PathFinding.getPathToTable(t);
}
else
{
_loc2_ = PathFinding.getPathBetweenTables(this.currentTable,t);
}
return _loc2_;
};
_loc2_.createBackPath = function(t)
{
if(this.currentTable == null)
{
return [];
}
var _loc2_ = PathFinding.getPathFromTable(t);
return _loc2_;
};
_loc2_.addPointToPath = function(p, path)
{
var _loc2_ = path[path.length - 1];
var _loc1_ = p;
if(_loc2_.x == _loc1_.x && _loc2_.y == _loc1_.y)
{
return undefined;
}
if(_loc2_.x == _loc1_.x || _loc2_.y == _loc1_.y)
{
path.push(p);
}
else
{
path.push({x:_loc1_.x,y:_loc2_.y});
path.push(p);
}
};
_loc2_.goBack = function(t, callBack, s)
{
this.__set__status(!s ? Waitress.WALK : s);
var obj = this;
this.setPath(this.createBackPath(t),function()
{
obj.currentTable = null;
obj.__set__status(Waitress.STAND);
callBack();
}
);
};
_loc2_.refreshDirection = function()
{
this.__get__mc()[this.__get__status()].gotoAndStop(this.direction);
};
_loc2_.setPath = function(path, endHandle)
{
if(path.length == 0)
{
this.tween.onMotionFinished = null;
this.tween.onMotionChanged = null;
this.tween = null;
endHandle();
return undefined;
}
var obj = this;
var _loc2_ = path.shift();
var _loc3_ = Math.sqrt((_loc2_.x - this.__get__mc()._x) * (_loc2_.x - this.__get__mc()._x) + (_loc2_.y - this.__get__mc()._y) * (_loc2_.y - this.__get__mc()._y)) / this.v;
if(_loc2_.x > this.__get__mc()._x)
{
if(_loc2_.y > this.__get__mc()._y)
{
this.setDirection(Direction.FACE);
}
else
{
this.setDirection(Direction.RIGHT);
}
}
else if(_loc2_.y > this.__get__mc()._y)
{
this.setDirection(Direction.LEFT);
}
else
{
this.setDirection(Direction.BACK);
}
this.tween = new mx.transitions.Tween(this.__get__mc(),"_y",mx.transitions.easing.None.easeOut,this.__get__mc()._y,_loc2_.y,_loc3_,true);
new mx.transitions.Tween(this.__get__mc(),"_x",mx.transitions.easing.None.easeOut,this.__get__mc()._x,_loc2_.x,_loc3_,true);
this.tween.onMotionFinished = function()
{
obj.setPath(path,endHandle);
};
this.tween.onMotionChanged = function()
{
Mission.getMission().refreshDepth();
};
};
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.STATUSCHANGEDEVENT = "waitressStatusChangedHandle";
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.STAND = "stand";
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.WALK = "walk";
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.FULL = "full";
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.EMPTY = "empty";
_global.Waitress = function($mc)
{
super($mc);
this.__set__status(Waitress.STAND);
}.MUSIC = "music";
_loc2_.direction = 1;
_loc2_.v = 200;
_loc2_._isBusy = false;
_loc2_.currentTable = null;
§§push(_loc2_.addProperty("bornPoint",_loc2_.__get__bornPoint,function()
{
}
));
§§push(_loc2_.addProperty("isBusy",_loc2_.__get__isBusy,function()
{
}
));
§§push(_loc2_.addProperty("isMusicing",_loc2_.__get__isMusicing,function()
{
}
));
§§push(_loc2_.addProperty("rendezvousPoint",_loc2_.__get__rendezvousPoint,function()
{
}
));
§§push(_loc2_.addProperty("status",function()
{
}
,_loc2_.__set__status));
§§push(ASSetPropFlags(_global.Waitress.prototype,null,1));
}
§§pop();
}
}
§§goto(addr934);
}
§§push(function §\x1b�\x02§(§�\x07§, §\x01§, §\x02\x01§, §\x01§, §���\x03��\x03g§, _global, Waitress, STAND, __set__status, MissionItem, prototype, setDirection, direction, refreshDirection)
{
} - 1);
}
addr934: